package com.example.app3_1;

// DetailActivity.java
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;

public class DetailActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);

        // 获取传递的数据
        String title = getIntent().getStringExtra("title");
        String description = getIntent().getStringExtra("description");

        // 显示数据
        TextView titleView = findViewById(R.id.detail_title);
        TextView descriptionView = findViewById(R.id.detail_description);

        titleView.setText(title);
        descriptionView.setText(description);
    }
}
